<?php


namespace app\controller\test;



use think\facade\Env;

class Index extends Base
{
	
	// 测试
	public function initialize()
	{
		parent::initialize();
	}

    // index
    public function index(){
        echo 'index';
    }
	
	// 404
	// http://www.light2025.com/test/index/empty
	public function empty()
	{
		return $this->fetch('../404');
	}
	
	// header
	public function header()
	{
		return $this->fetch('../header');
	}
	
	// env
	public function env()
	{
		var_dump(Env::get('app.static_host'));
		var_dump(Env::get('database.DATABASE'));
		echo Env::get('DATABASE.DATABASE');
	}
	
	// ip
	public function ip()
	{
		return $this->fetch('../ip');
	}

	
	
	// http://www.light.com/test/index/jqk10
	public function jqk10()
	{
		$url    = 'https://ft.10jqka.com.cn/api/v1/get_access_token';
		$token  = 'eyJzaWduX3RpbWUiOiIyMDIxLTEyduX3RpbWUiOiIyMjI1In0=.eyJ1aWQiOiIxMDYxMDUwMDMifQ==.F4CBB
BC230969B0F220F9D6ECB666A230969B0F220FFBBCDA4156A3B78A1BB896';
		$curl   = new Curl();
		$header = ["Content-Type:application/json", "refresh_token:{$token}"];
		$_res   = $curl->header($header)->request($url);
		var_dump($_res);
		
		return $this->success($_res);
	}
	

	

	
}
